<?php
define('BEVIN', TRUE);
if(strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
	exit("0");
}

include_once("include/common.inc.php");

$uid = $user->checkUserLogin();
if(!$uid) {
	exit("0");
}

$key_array = array('company','name','post','telphone','fax','phone','address','qq','email','msn','website','business','cardid');
$new_post_array = array();
foreach($_POST as $key=>$value) {
	if(in_array($key,$key_array)) {
		$new_post_array[$key] = htmlspecialchars($value);
	}
}

if($result = $card->updateCardInfo($new_post_array)){
	echo $result;
	exit();
} else {
	exit("0");
}
?>